package io.renren.modules.substation.entity;

import java.util.List;

public class EnvironmentInfo {

    public static final String TEMPERATURENAME = "1";
    public static final String HUMIDITYNAME = "2";
    public static final String SF6NAME = "3";
    public static final String O2NAME = "4";
    public static final String O3NAME = "5";

    private String devCode ;
    private String kind ;

    private String temperatureValue ;
    private String humidityValue ;
    private String sf6Value;
    private String o2Value ;
    private String o3Value ;

    private String temperatureSymbol ;
    private String humiditySymbol ;
    private String sf6Symbol;
    private String o2Symbol ;
    private String o3Symbol ;


    private String showInfo ;

    private List<TBusiDevMonitorInfoEntity> dtlList;

    public String getTemperatureValue() {
        return temperatureValue;
    }

    public void setTemperatureValue(String temperatureValue) {
        this.temperatureValue = temperatureValue;
    }

    public String getHumidityValue() {
        return humidityValue;
    }

    public void setHumidityValue(String humidityValue) {
        this.humidityValue = humidityValue;
    }

    public String getSf6Value() {
        return sf6Value;
    }

    public void setSf6Value(String sf6Value) {
        this.sf6Value = sf6Value;
    }

    public String getO2Value() {
        return o2Value;
    }

    public void setO2Value(String o2Value) {
        this.o2Value = o2Value;
    }

    public String getO3Value() {
        return o3Value;
    }

    public void setO3Value(String o3Value) {
        this.o3Value = o3Value;
    }

    public String getShowInfo() {
        return showInfo;
    }

    public void setShowInfo(String showInfo) {
        this.showInfo = showInfo;
    }
    public void setShowInfo() {
        String showInfo="";
        showInfo+= "温度："+temperatureValue +"°c";
        showInfo+= "湿度："+humidityValue +"%RH";
        showInfo+= "SF6："+ sf6Value +"ppm";
        showInfo+= "O2："+o2Value +"%";
        showInfo+= "O3："+o3Value +"ppb";
        this.showInfo=showInfo;
    }

    public void setShowInfoByList() {
        List<TBusiDevMonitorInfoEntity> dtl=getDtlList();

        temperatureSymbol="°c";
        humiditySymbol="%RH";
        sf6Symbol ="ppm";
        o2Symbol="%";
        o3Symbol="ppb";

        String showInfo="";
        for(TBusiDevMonitorInfoEntity m : dtl){
            String symbol="";
            if(m.getVariableCode().equals(TEMPERATURENAME))
            {
                temperatureValue=m.getVariableValue();
                symbol=temperatureSymbol;
            }else  if(m.getVariableCode().equals(HUMIDITYNAME))
            {
                humidityValue=m.getVariableValue();
                symbol=humiditySymbol;
            }
            else  if(m.getVariableCode().equals(SF6NAME))
            {
                sf6Value =m.getVariableValue();
                symbol= sf6Symbol;
            }
            else  if(m.getVariableCode().equals(O2NAME))
            {
                o2Value=m.getVariableValue();
                symbol=o2Symbol;
            }else  if(m.getVariableCode().equals(O3NAME))
            {
                o3Value=m.getVariableValue();
                symbol=o3Symbol;
            }
            showInfo+=(m.getVariableDesc()+": "+m.getVariableValue() + symbol +"\n");
        }
        this.showInfo = showInfo;
    }

    public List<TBusiDevMonitorInfoEntity> getDtlList() {
        return dtlList;
    }

    public void setDtlList(List<TBusiDevMonitorInfoEntity> dtlList) {
        this.dtlList = dtlList;
    }

    public String getDevCode() {
        return devCode;
    }

    public void setDevCode(String devCode) {
        this.devCode = devCode;
    }

    public String getKind() {
        return kind;
    }

    public void setKind(String kind) {
        this.kind = kind;
    }
}
